<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <hr>
      <h2 @click='handler1("good")' style="color: red;"> {{msg}}</h2>
      <hr>
      <!-- 什么都不传 -->
      <a href="http://www.baidu.com" @click='handler2'>{{msg}}</a>
      <hr>
      <a href="http://www.baidu.com" @click='handler3("1","2",$event)'>{{msg}}</a>

      <hr>
      <div @click='handler4' style="color: pink;">
    事件修饰符
    <a href="http://www.baidu.com" @click.prevent.stop='handler4'>{{msg}}</a>
</div>

<input @keyup.enter.65.stop.prevent='onEnter' type="text">
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          num:100,
          msg:"我是vue的方法基本使用 get: "
      },
      methods:{
          handler1(data) {
              this.msg += data
          },
          handler2(e) {
              e.preventDefault()
          },
          handler3(data1,data2,e) {
              console.log(data1);
              console.log(data2);
              console.log(e)
              e.preventDefault()
          },
          handler4() {
              console.log("修饰符的基本使用")
          },
          onEnter() {
            console.log(this.num)
          }
      }
     });
  </script>
</body>
</html>
